#ifndef							__QTASYNCUDPSOCKET_H__
#define							__QTASYNCUDPSOCKET_H__

#include						<QtNetwork/QUdpSocket>
#include						<qobject.h>
#include						"ASocket.h"
#include						"byte.h"
#include						"processor.h"

class							QtAsyncUdpSocket : public ASocket
{
	Q_OBJECT

private:
	QUdpSocket					_socket;
	QHostAddress				_ip;

private:
	virtual void				_receiveUdp(size_t);


public:
	QtAsyncUdpSocket();
	~QtAsyncUdpSocket();

public:
	virtual void				init();
	virtual void				close();
	virtual void				connectToHost(const std::string &, const std::string &);
	void						sendPacket(Packet *, QHostAddress &, quint16 id = 4244);
	virtual void				sendPacket(Packet *);
	virtual QHostAddress 		getIp() const;

	private slots:
		void					handleRead();
};

#endif							// !__QTASYNCUDPSOCKET_H__
